#ifndef _TELFile
#define _TELFile

#include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<vector>
using namespace std;

#include<TROOT.h>
#include<TFile.h>
#include<TTree.h>
#include<TMath.h>
#include<TLine.h>

#include<Global.h>
#include<TELAlign.h>
#include<Align.h>

#define EventLength 1280*3 + 20 + 256 + 10

class TELFile{

  Int_t RunNumber;

  Global* glob;

  const Char_t* SiFilePath;
  FILE* SiFile;
  char CharTmp[20];

  Int_t NumDataFile;

  Double_t Trigger[2];
  Char_t Path[200];

  Int_t ADCXSize;
  Int_t* PlaneXADC;
  Int_t ADCYSize;
  Int_t* PlaneYADC;
  Int_t* ShiftX;
  Int_t* ShiftY;

  Float_t* PedX;
  Float_t* PedY;
  Float_t* NoiX;
  Float_t* NoiY;

  Char_t* TELRoot;
  Char_t* Hitos_file;
  TFile* TELData;
  TTree* TELTree;

  TELAlign* PreAlignment;
  Align* Alignment;
  Double_t* APara;

 public:

  //TETELFile();
  TELFile(Int_t);
  ~TELFile();

  Int_t ReadEvents();
  Int_t swap4(Int_t w4);

  void SimplePedNoi();
  void PedNoi();
  void FindClusters(Int_t,Int_t);
  void HitNtupl(Int_t,Int_t);
  void HitNtuplWithEta(Int_t,Int_t,Int_t);
  void TelChek();
  void ArtemAligment(Int_t,Int_t);


};

#endif
